
//对axios进行二次封装
// url：请求地址
// type：请求类型
// data：get请求的参数是parmas  post请求的参数是data
// obj：data里面的对象
function request(url, type = "get", obj = {}, data) {
    axios({
        method: type,
        url: url,
        data: {...obj}
    });
}

// const register = data => request("../php/register.php", data, "post");

// 注册
const register = obj => request("http://localhost:2345/usernameinfos", "post", obj, data);